import { OmitType, PickType } from '@nestjs/swagger'

import { IsString } from 'class-validator'
import { User } from '@/modules/user/entities/user.entity'

export class CreateUserDto extends PickType(User, ['username', 'password']) {}

export class UpdateUserDto extends PickType(User, []) {}

export class LoginUserDto extends PickType(User, ['username', 'password']) {
  /**
   * 验证码
   */
  @IsString()
  code: string
}

export class UserResDto extends OmitType(User, ['password']) {}

export class UserDetailDto extends OmitType(User, ['password']) {}
